export default [
  {
    url: "/tick-basic/sys/login", // 模拟登录接口
    method: "POST", // 请求方式
    timeout: 3000, // 超时事件
    statusCode: 200, // 返回的http状态码
    response: (option: any) => {
      if (option.body.userName == "admin" || option.body.userName == "test") {
        // 返回的结果集
        return {
          code: 200,
          message: "登录成功",
          success: true,
          data: {
            id: "@id",
            failure_time: Math.ceil(new Date().getTime() / 1000) + 24 * 60 * 60,
            account: option.body.userName,
            token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJhdhwIjoxNjI3NTMxNjcwfQ",
            userInfo: {
              userName: option.body.userName,
              avatar: "user/20190119/logo-2_1547868176839.png",
              roleId: "f6817f48af4fb3af11b9e8bf182f618b",
              roleName: option.body.userName == "admin" ? "管理员" : "测试人员",
              status: 1,
            },
          },
        };
      } else {
        return {
          code: 500,
          message: "账号不存在",
          success: false,
          data: {},
        };
      }
    },
  },
];
